package fhp.hlhj.giantfold.presenter

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.interfaces.IMall
import fhp.hlhj.giantfold.javaBean.GoodListBean
import fhp.hlhj.giantfold.javaBean.MallBean
import fhp.hlhj.giantfold.module.MallModule

/**
 * author: FHP
 * data: on 2018\1\16 0016 13:51
 * E-Mail: 103945089@qq.com
 */
class MallPresenter(private val iMall: IMall) : MallModule.MallListener {

    private val mallModule=MallModule()

    /**
     * 设置点击事件
     */
    fun setItemclick(){
        iMall.setItemClick()
    }
    /**
     * 获取信息
     */
    fun getMall(params: HttpParams){
        mallModule.getMall(params,this)
    }

    /**
     * 获取商品列表
     */
    fun getGoods(params: HttpParams){
        mallModule.getGood(params,this)
    }
    override fun showLoading() {
        iMall.showLoading()
    }

    override fun onMallListener(mallBean: MallBean) {
        iMall.getMall(mallBean)
    }
    override fun onGoodsListenr(goodListBean: GoodListBean) {
        iMall.getGoods(goodListBean)
    }

}
